// JavaScript Document

var Rancard = {
	
    init: function() {
        Rancard.handleEvents();
        $('#feedDicker').rssfeed('http://www.rancardsolutions.com/index.php?id=61',{}, function(e) {
            $(e).find('div.rssBody').vTicker({ showItems: 1});
        });		
    },
	
    handleEvents: function() {
        $('a[rel=jumpto]').bind('click', function(e) {
            var target = null;
            target = $('h3[data-id="' + $(this).attr('data-content') + '"], h2 a[data-id="' + $(this).attr('data-content') + '"]');
            if (target.length > 0) {
                var offset = $(target).offset().top - 60;
                $('html,body').animate({
                    scrollTop: offset
                },2000);
            }
            e.preventDefault();
        });
        
        $('a.to-top').bind('click', function(e) {
            $('html,body').animate({
                scrollTop: 0
            },2000);
            e.preventDefault();
        });
    }	
}

$(function() {
    Rancard.init();	
})